import request from '@/utils/request'

/**
 * 获取员工信息
 * @param {obj} data 查询参数
 */
export function getStaffInfo(data) {
  return request({
    url: `/call-center/api/v1/staffInfo/page`,
    method: 'POST',
    data
  })
}

/**
 * 更新平台工号
 * @param {string} id id
 * @param {array} platformNo data
 */
export function updateStaffInfo(id, data) {
  return request({
    url: `/call-center/api/v1/staffInfo/${id}`,
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

export function getUserOrgInfo(orgCode) {
  return request({
    url: `/call-center/api/v1/staffInfo/user/org/${orgCode}`,
    method: 'POST'
  })
}

/**
 * 职员商机来源配置
 * @param {*} staffId
 * @param {*} validList
 * @returns
 */
export function staffBusinessOpportunitySource(staffId, validList) {
  return request({
    url: `/call-center/api/v1/staffBusinessOpportunitySource/${staffId}`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: validList
  })
}
/**
 * 配置手机号
 * @param {*} id
 * @param {*} data
 * @returns
 */
export function transferPhone(id, data) {
  return request({
    url: `/call-center/api/v1/staffInfo/transferPhone/${id}`,
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

// 批量更新呼叫平台
export function updateCallPlatform(callPlatform, data) {
  return request({
    url: `/call-center/api/v1/staffInfo/callPlatform/batch/${callPlatform}`,
    method: 'PUT',
    data
  })
}
